@import "./variable.scss";
/*根据dpr计算font-size*/
@mixin font_dpr($font-size) {
  font-size: $font-size;
  [data-dpr="2"] & {
    font-size: $font-size * 2;
  }
  [data-dpr="3"] & {
    font-size: $font-size * 3;
  }
  @media screen and (-webkit-min-device-pixel-ratio: 2) {
    font-size: $font-size * 2;
  }
  @media screen and (-webkit-min-device-pixel-ratio: 3) {
    font-size: $font-size * 3;
  }
}

/*通过该函数设置字体大小，后期方便统一管理；*/
@mixin font_size($size) {
  @include font_dpr($size);
}

// 不换行
@mixin no-wrap() {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

// 限制行数
@mixin clamp($row) {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: $row;
}

// 根据属性选择器来设置背景颜色
@mixin bg_color() {
  background: $background-color-theme;
  [data-theme=theme1] & {
    background: $background-color-theme1;
  }
  [data-theme=theme2] & {
    background: $background-color-theme2;
  }
}

@mixin bg_sub_color() {
  background: $background-color-sub-theme;
  [data-theme=theme1] & {
    background: $background-color-sub-theme1;
  }
  [data-theme=theme2] & {
    background: $background-color-sub-theme2;
  }
}
@mixin bg_gray_color() {
  background: $border-color-theme-e0;
  [data-theme=theme1] & {
    background: $border-color-theme-e0;
  }
  [data-theme=theme2] & {
    background: $border-color-theme-3c;
  }
}

@mixin font_color() {
  color: $font-color-theme;
  [data-theme=theme1] & {
    color: $font-color-theme1;
  }
  [data-theme=theme2] & {
    color: $font-color-theme2;
  }
}

@mixin font_active_color() {
  color: $font-active-color-theme;
  [data-theme=theme1] & {
    color: $font-active-color-theme1;
  }
  [data-theme=theme2] & {
    color: $font-active-color-theme2;
  }
}

@mixin bullet_active_color() {
  background: $font-active-color-theme;
  [data-theme=theme1] & {
    background: $font-active-color-theme1;
  }
  [data-theme=theme2] & {
    background: $font-active-color-theme2;
  }
}


@mixin border_color() {
  border-color: $border-color-theme;
  [data-theme=theme1] & {
    border-color: $border-color-theme1;
  }
  [data-theme=theme2] & {
    border-color: $border-color-theme2;
  }
}

@mixin bg_img($url) {
  [data-theme=theme] & {
    background-image: url($url + '_163.png');
  }
  [data-theme=theme1] & {
    background-image: url($url + '_qq.png');
  }
  [data-theme=theme2] & {
    background-image: url($url + '_it666.png');
  }
  background-size: cover;
  background-repeat: no-repeat;

  [data-theme=theme][data-dpr='2'] & {
    background-image: url($url + '_163@2x.png');
  }
  [data-theme=theme][data-dpr='3'] & {
    background-image: url($url + '_163@3x.png');
  }
  [data-theme=theme1][data-dpr='2'] & {
    background-image: url($url + '_qq@2x.png');
  }
  [data-theme=theme1][data-dpr='3'] & {
    background-image: url($url + '_qq@3x.png');
  }
  [data-theme=theme2][data-dpr='2'] & {
    background-image: url($url + '_it666@2x.png');
  }
  [data-theme=theme2][data-dpr='3'] & {
    background-image: url($url + '_it666@3x.png');
  }
  @media screen and (-webkit-min-device-pixel-ratio: 2) {
    [data-theme=theme] & {
      background-image: url($url + '_163@2x.png');
    }
    [data-theme=theme1] & {
      background-image: url($url + '_qq@2x.png');
    }
    [data-theme=theme2] & {
      background-image: url($url + '_it666@2x.png');
    }
  }
  @media screen and (-webkit-min-device-pixel-ratio: 3) {
    [data-theme=theme] & {
      background-image: url($url + '_163@3x.png');
    }
    [data-theme=theme1] & {
      background-image: url($url + '_qq@3x.png');
    }
    [data-theme=theme2] & {
      background-image: url($url + '_it666@3x.png');
    }
  }
}

